package com.example.designPatterns.state;

/**
 * @Title: OrderStateContext
 * @Description: TODO
 * @Date 2021/9/30 9:53
 */
public class OrderStateContext {
    private AbstractOrderState orderState;

    public OrderStateContext() {
    }

    public AbstractOrderState getOrderState() {
        return orderState;
    }

    public void setOrderState(AbstractOrderState orderState) {
        this.orderState = orderState;
    }

    /**
     * 具体操作,根据状态来进行操作
     *
     * @param order order
     */
    void execute(Order order) {
        orderState.execute(this, order);
    }

}
